package com.xiaohei.activiti;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

/**
 * ClassName: MyTaskListener
 * Package:
 * Description:
 *
 *
 * @Author:xiaohei
 * @Create 2024/5/4 17:02
 * Version 1.0
 */
public class MyTaskListener implements TaskListener {

    @Override
    public void notify(DelegateTask delegateTask) {
        if(delegateTask.getName().equals("经理审批")){
            //分配任务
            delegateTask.setAssignee("Jack");
        }else if(delegateTask.getName().equals("人事审批")){
            delegateTask.setAssignee("tom");
        }
    }

}
